import service from "../http";

// 登入
export function login(data = {}) {
  return service.post("/user/login", data);
}

// 注册
export function register(data = {}) {
  return service.post("/user/register", data);
}

// 更新头像
export function updateAvatar(data = {}) {
  return service.post("/user/avatar", data);
}

// 更新密码

export function updatePassword(data = {}) {
  return service.post("/user/password", data);
}

// 获取用户表格数据
export function getUserData(data = {}) {
  return service.post("/user/getUser", data);
}

export function batchAddUser(data = {}) {
  return service.post("/user/batchAdd", data);
}

export function batchUpdateUser(data = {}) {
  return service.post("/user/batchUpdate", data);
}

export function batchDeteleUser(data = {}) {
  return service.post("/user/batchDetele", data);
}

export function uploadImage(data = {}) {
  return service.post("/goods/upload", data);
}

export function addGoods(data = {}) {
  return service.post("/goods/add", data);
}

export function getGoodsData(data = {}) {
  return service.post("/goods/getGoods", data);
}

export function updateGoodsData(data = {}) {
  return service.post("/goods/update", data);
}

export function batchDeteleGoodsData(data = {}) {
  return service.post("/goods/batchDetele", data);
}

export function getAllGoodsData(data = {}) {
  return service.post("/goods/getAllGoods", data);
}

export function getOnlyGoodsData(data = {}) {
  return service.post("/goods/getOne", data);
}

export function getShoppingData(data = {}) {
  return service.post("/shopping/getShopping", data);
}

export function addShoppingData(data = {}) {
  return service.post("/shopping/add", data);
}

export function batchDeteleShopping(data = {}) {
  return service.post("/shopping/batchDelete", data);
}

export function updateGoodsNum(data = {}) {
  return service.post("/goods/updateNum", data);
}

export function getBuyordersData(data = {}) {
  return service.post("/orders/getBuyorders", data);
}

export function getSaleordersData(data = {}) {
  return service.post("/orders/getSaleorders", data);
}

export function addOrdersData(data = {}) {
  return service.post("/orders/add", data);
}

export function batchDeteleOrders(data = {}) {
  return service.post("/orders/batchDelete", data);
}
